import { useSelector, useDispatch } from "react-redux";
import { setLayers } from "@/store";
import styles from "./index.module.scss";

export default function Cost() {
  const dispatch = useDispatch();
  const layers = useSelector((state) => {
    return state.layers;
  });
  const openModel = (name) => {
    dispatch(
      setLayers({
        query: {},
        name,
        other: {},
      })
    );
    console.log(layers);
  };
  return (
    <>
      <div className="content cb-box">
        <div className="content-item w-50" onClick={() => openModel("model8")}>
          <div className="content-val text-overflow">25,627</div>
          <div className="content-title">人员成本</div>
        </div>
        <div className="content-item w-50" onClick={() => openModel("model9")}>
          <div className="content-val text-overflow color-green">25,627</div>
          <div className="content-title">车辆成本</div>
        </div>
        <div className="content-item w-50" onClick={() => openModel("model10")}>
          <div className="content-val text-overflow">25,627</div>
          <div className="content-title">塔工成本</div>
        </div>
        <div className="content-item w-50" onClick={() => openModel("model11")}>
          <div className="content-val text-overflow color-green">25,627</div>
          <div className="content-title">零星技术服务费</div>
        </div>
        <div className="content-item w-50" onClick={() => openModel("model12")}>
          <div className="content-val text-overflow">25,627</div>
          <div className="content-title">社保成本</div>
        </div>
        <div className="content-item w-50" onClick={() => openModel("model13")}>
          <div className="content-val text-overflow color-green">25,627</div>
          <div className="content-title">劳务成本</div>
        </div>
        <div className="content-item w-50" onClick={() => openModel("model14")}>
          <div className="content-val text-overflow">25,627</div>
          <div className="content-title">报销成本</div>
        </div>
        <div className="content-item w-50" onClick={() => openModel("model15")}>
          <div className="content-val text-overflow color-green">25,627</div>
          <div className="content-title">意外险成本</div>
        </div>
      </div>
    </>
  );
}
